﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using EzDesk.EzAppApi.Utility.EzDeskAppApi;
using EzDesk.Project.Model;
using EzDesk.Utility.Web.Extensions;

namespace EzDesk.Project.DesktopWeb.Models
{
    public class GanttPlaneTaskModel
    {
        public GanttPlaneTaskModel() { }

        public GanttPlaneTaskModel(PlaneTask planeTask)
        {
            this.Id = planeTask.Id.ToString();
            this.Name = planeTask.Name + "阶段";
            this.StartOn = planeTask.StartOn.ToEpoch();
            this.Director = planeTask.Director;
            this.TeamMembers = new SimpleUser[0];
            this.ChildTasks = new GanttTaskModel[0];
        }

        public string Id { get; set; }
        public string Name { get; set; }
        public SimpleUser Director { get; set; }
        public int StartOn { get; set; }
        public SimpleUser[] TeamMembers { get; set; }
        public GanttTaskModel[] ChildTasks { get; set; }
        public GanttTaskModel[] ChangedTasks { get; set; }

        public string ClientAction { get; set; }
        public int ClientActionDate { get; set; }
    }
}